From cf16de50e225d552dd68e00095ac18dc39cc9968 Mon Sep 17 00:00:00 2001 From: Rene Engelhard Date: Fri, 15 Dec 2023 23:45:04 +0100 Subject: [PATCH] [PATCH] fix system-abseil build even with 2022 version actually it seems it was a internal abseil header from pdfium vs. system header mismatch. Include proper absl/container/inlined_vector.h if using system-abseil. While at it we can also just use pkg-config, no idea why I did it without back then. Also gets the advantage that it knows that the libs needed for absl_inlined_vector is actually -labsl_throw_delegate -labsl_raw_logging_internal -labsl_log_severity This effectively reverts e89723103313ec4366ee58144c47d7a5c16bf838 Change-Id: Ide4f79860b4e0673c5c6587d503058bdd2930744 Gbp-Pq: Name fix-system-abseil-build.diff --- configure.ac | Bin 553265 -> 552729 bytes external/pdfium/Library_pdfium.mk | 5 +++++ external/pdfium/UnpackedTarball_pdfium.mk | 2 ++ external/pdfium/annot.patch.1 | 13 ++++++++++++- external/pdfium/system-abseil.diff | 15 +++++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 external/pdfium/system-abseil.diff diff --git a/configure.ac b/configure.ac index bb8f9e953883cb93bcdfa850955928c5847294ba..3079e690862d1a6053dd1f9bf906bf63f46f1a1f 100644 GIT binary patch delta 119 zcmdn^NO9&p#fBEf7N!>F7M2#)Eo>Frr8xt<-Q%4-T%En+ef?cReO!Yz9G!w)J$-Z( zrtjOyCaIH{RGbr^l$a7F7M2#)Eo>Frr(I^_n6BN(CLouXRGgz;prD#*m$PD^J3$jZm@-wT^3DySz=LU zVqOVB-9ic=jqzA)jMY(y&P~kBn=ZJLReJjS#jFBSIhjc~R8JT5VH0N2i`9&suGq*1 zbeshnt2|sSs$(z>W(FEOea&_@iRr>VY=QwGV>G!Gpuo{7*wxb~-pA7^*j7n52W}`@ c04X3zq1vZ3{ljB6mG-~e*|z`P&MvbZ0JnpUp#T5? diff --git a/external/pdfium/Library_pdfium.mk b/external/pdfium/Library_pdfium.mk index fc0903d873d..85f9d953b75 100644 --- a/external/pdfium/Library_pdfium.mk +++ b/external/pdfium/Library_pdfium.mk @@ -40,6 +40,11 @@ $(eval $(call gb_Library_add_defs,pdfium,\ -DUSE_SYSTEM_LIBOPENJPEG2 \ )) endif +ifeq ($(SYSTEM_ABSEIL),TRUE) +$(eval $(call gb_Library_add_defs,pdfium,\ + -DUSE_SYSTEM_ABSEIL \ +)) +endif $(eval $(call gb_Library_set_generated_cxx_suffix,pdfium,cpp)) diff --git a/external/pdfium/UnpackedTarball_pdfium.mk b/external/pdfium/UnpackedTarball_pdfium.mk index 73f8c2f528f..58ff8cea798 100644 --- a/external/pdfium/UnpackedTarball_pdfium.mk +++ b/external/pdfium/UnpackedTarball_pdfium.mk @@ -18,6 +18,8 @@ pdfium_patches += constexpr-template.patch pdfium_patches += annot.patch.1 +pdfium_patches += system-abseil.diff + $(eval $(call gb_UnpackedTarball_UnpackedTarball,pdfium)) $(eval $(call gb_UnpackedTarball_set_tarball,pdfium,$(PDFIUM_TARBALL))) diff --git a/external/pdfium/annot.patch.1 b/external/pdfium/annot.patch.1 index 330685962b4..178bf4dc61e 100644 --- a/external/pdfium/annot.patch.1 +++ b/external/pdfium/annot.patch.1 @@ -2,6 +2,17 @@ diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp index bc1f7f7eb..075baf1df 100644 --- a/fpdfsdk/fpdf_annot.cpp +++ b/fpdfsdk/fpdf_annot.cpp +@@ -8,6 +8,10 @@ + #include + #include + #include ++#ifdef USE_SYSTEM_ABSEIL ++#include ++#include ++#endif + + #include "constants/annotation_common.h" + #include "core/fpdfapi/edit/cpdf_pagecontentgenerator.h" @@ -1366,6 +1366,42 @@ FPDFAnnot_GetFontSize(FPDF_FORMHANDLE hHandle, return true; } @@ -32,7 +43,7 @@ index bc1f7f7eb..075baf1df 100644 + if (!pWidget) + return false; + -+ std::optional text_color = pWidget->GetTextColor(); ++ absl::optional text_color = pWidget->GetTextColor(); + if (!text_color) + return false; + diff --git a/external/pdfium/system-abseil.diff b/external/pdfium/system-abseil.diff new file mode 100644 index 00000000000..841bc8ce946 --- /dev/null +++ b/external/pdfium/system-abseil.diff @@ -0,0 +1,15 @@ +--- core/fpdfapi/page/cpdf_sampledfunc.cpp 2023-12-15 23:27:10.955659091 +0100 ++++ core/fpdfapi/page/cpdf_sampledfunc.cpp 2023-12-15 23:27:43.420136476 +0100 +@@ -16,8 +16,11 @@ + #include "core/fxcrt/cfx_bitstream.h" + #include "core/fxcrt/fx_memory_wrappers.h" + #include "core/fxcrt/fx_safe_types.h" ++#ifdef USE_SYSTEM_ABSEIL ++#include ++#else + #include "third_party/abseil-cpp/absl/container/inlined_vector.h" +- ++#endif + namespace { + + // See PDF Reference 1.7, page 170, table 3.36. -- 2.30.2